package com.yy.okhttp;

import java.util.concurrent.ThreadFactory;

/**
 * User: gongyongfeng2@yy.com
 * Date: 2020/7/27 16 :12
 */
class Utils {
    public static ThreadFactory threadFactory(final String name, final boolean daemon) {
        return new ThreadFactory() {
            @Override
            public Thread newThread(Runnable runnable) {
                Thread result = new Thread(runnable, name);
                result.setDaemon(daemon);
                return result;
            }
        };
    }
}
